import 'package:flutter/material.dart';

class TextPage extends StatefulWidget {
  @override
  _TextPageState createState() => new _TextPageState();
}

class _TextPageState extends State<TextPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Container"),
      ),
      body: _buildListView(),
    );
  }

  Widget _buildListView() {
    return ListView.builder(
      itemBuilder: (context, index) {
        return _buildListViewItem(index);
      },
      itemCount: texts.length,
    );
  }

  Widget _buildListViewItem(index) {
    return Container(
      padding: EdgeInsets.all(10.0),
      alignment: Alignment.center,
      child: texts[index],
    );
  }
}

List<Widget> texts = <Widget>[
  Column(
    children: <Widget>[
      Text("Text color"),
      Container(
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: <Widget>[
            Text(
              "Gnerv",
              style: TextStyle(
                color: Colors.blue,
                backgroundColor: Colors.amberAccent,
              ),
            ),
            Text(
              "Gnerv",
              style: TextStyle(
                fontSize: 20,
                fontStyle: FontStyle.italic,
              ),
            ),
          ],
        ),
      ),
    ],
  ),
  Column(
    children: <Widget>[
      Text("Text softWrap overflow"),
      Container(
        child: Column(
          children: <Widget>[
            Text(
              "GnervGnervGnervGnervGnervGnervGnervGnervGnervGnervGnervGnerv",
              softWrap: true,
            ),
            Text(
              "GnervGnervGnervGnervGnervGnervGnervGnervGnervGnervGnervGnerv",
              softWrap: false,
              overflow: TextOverflow.ellipsis,
            ),
          ],
        ),
      ),
    ],
  ),
];
